package org.newlucene.core.search;

import java.io.IOException;

import org.newlucene.core.index.IndexReader;

public abstract class IndexSearcher 
{
	protected IndexReader indexReader;
	protected float boost = 1.0f;
	
	public IndexSearcher(IndexReader indexReader)
	{
		this.indexReader = indexReader;
	}
	
	public void setBoost(float boost)
	{
		this.boost = boost;
	}
	
    public void search(HitCollector hc) throws IOException
    {
   		search(hc, indexReader.maxDoc());
    }   
	
	abstract protected void search(HitCollector hc, int maxDocNum) throws IOException;
	
	abstract public String explain(); // for debugging purpose, print out the searcher
}